<?php


use App\Http\Controllers\BookingController;
use App\Http\Controllers\EasyWechat\WxMiniController;
use App\Http\Controllers\ToolController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\OtherInfoController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

// 拼本
Route::prefix('booking')->group(function () {
    // 列表
    Route::any('/list', [BookingController::class, 'list']);
    // 新增
    Route::any('/create', [BookingController::class, 'create']);
    // 我的列表
    Route::any('/myList', [BookingController::class, 'myList']);
    // 更新
    Route::any('/update', [BookingController::class, 'update']);
});

// easyWechat wxMini
Route::prefix('wxMini')->group(function () {
    // 获取openid
    Route::any('/getOpenid', [WxMiniController::class, 'getOpenid']);
});

// 工具类
Route::prefix('tools')->group(function () {
    Route::any('/cq', [ToolController::class, 'cq']);
});

// 其他信息相关接口
Route::prefix('otherInfo')->group(function () {
    Route::any('list', [OtherInfoController::class, 'list']);
    Route::any('create', [OtherInfoController::class, 'create']);
    Route::any('delete', [OtherInfoController::class, 'delete']);
});
